<template>
    <div class="index">
        <div class="topBg"></div>
        <div class="top">
            <div class="box">
                <div class="tab">
                    <router-link to="/homework">
                    <div :class="{ select: this.$route.path.includes('homework') }">作业<hr/></div>
                    </router-link>
                    <router-link to="/test">
                    <div :class="{ select: this.$route.path.includes('test') }">考试题<hr/></div>
                    </router-link>
                    <router-link to="/exercises">
                    <div :class="{ select:['/exercisesDetail','/exercises'].includes(this.$route.path)  }">练习题<hr/></div>
                    </router-link>
                </div>
            </div>
        </div>
        <router-view/>
    </div>
</template>

<script>
  export default {
    name: 'index'
  }
</script>

<style scoped lang="less">
    .select{
        color: #ffffff !important;
        hr{
            margin: 8px auto !important;
            width: 35px !important;
            display: block !important;
        }
    }
    .index{
        margin-top: 80px;
        .topBg{
            background-color: #4A6BD6;
            width: 100%;
            height: 100%;
        }
        .top{
            min-width: 1290px;
            width: 100%;
            height: 80px;
            background: #4859c9;
            .box{
                width: 1200px;
                height: 100%;
                margin: 0 auto;
                display: flex;
                align-items: center;
                justify-content: space-between;
            }
            .tab{
                display: flex;
                width: 400px;
                justify-content: space-around;
                div{
                    height: 30px;
                    width: 100px;
                    font-size: 22px;
                    font-family: Microsoft YaHei;
                    font-weight: 400;
                    color: #B1CDF5;
                    line-height: 18px;
                    hr{
                        display: none;
                    }

                }
                div:hover{
                    color: #ffffff;
                    hr{
                        margin: 8px auto;
                        width: 35px;
                        display: block;
                    }
                }
            }

        }
    }
</style>
